package basics.day17.SystemDemo;

/*
 * currentTimeMillis()
 * 返回以毫秒为单位的当前时间
 * */
public class CurrentTimeMillisDemo {
    public static void main(String[] args) {
        // 计算程序运行时间
        long start = System.currentTimeMillis();
        int k = 0;
        for (int i = 0; i < 1000000; i++) {
            k = k + i;
        }
        long end = System.currentTimeMillis();
        System.out.println(k);
        System.out.println(end - start);
    }
}
